From b6714135675e96f8c13ad5dbd3dce9b796f8a389 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Tue, 4 Nov 2003 14:18:59 +0000 Subject: [PATCH] bitkeeper revision 1.556 (3fa7b553guSnjbQHPSIHI8pvbUVpdg) setup.c, network.c: A couple more bug fixes in xenolinux suspend/resume code. --- .../arch/xeno/drivers/network/network.c | 19 +++++++++++++++++-- .../arch/xeno/kernel/setup.c | 19 +++++++++---------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c index 748571a98f..31611b433e 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c @@ -83,10 +83,13 @@ struct net_private _id; }) -static void dbg_network_int(int irq, void *dev_id, struct pt_regs *ptregs) +static void _dbg_network_int(struct net_device *dev) { - struct net_device *dev = (struct net_device *)dev_id; struct net_private *np = dev->priv; + + if ( np->state == STATE_CLOSED ) + return; + printk(KERN_ALERT "tx_full = %d, tx_entries = %d, tx_resp_cons = %d," " tx_req_prod = %d, tx_resp_prod = %d, tx_event = %d, state=%d\n", np->tx_full, atomic_read(&np->tx_entries), np->tx_resp_cons, @@ -100,6 +103,18 @@ static void dbg_network_int(int irq, void *dev_id, struct pt_regs *ptregs) } +static void dbg_network_int(int irq, void *unused, struct pt_regs *ptregs) +{ + struct list_head *ent; + struct net_private *np; + list_for_each ( ent, &dev_list ) + { + np = list_entry(ent, struct net_private, list); + _dbg_network_int(np->dev); + } +} + + static int network_open(struct net_device *dev) { struct net_private *np = dev->priv; diff --git a/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c b/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c index 9c70c61a71..b952f12385 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c +++ b/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c @@ -46,6 +46,7 @@ #include #include #include +#include #include /* @@ -1066,15 +1067,14 @@ static void stop_task(void *unused) char name[6]; int i; - /* Close down all Ethernet interfaces. */ + rtnl_lock(); for ( i = 0; i < 10; i++ ) { sprintf(name, "eth%d", i); - if ( (dev = dev_get_by_name(name)) == NULL ) - continue; - dev_close(dev); - dev_put(dev); + if ( (dev = __dev_get_by_name(name)) != NULL ) + dev_close(dev); } + rtnl_unlock(); blkdev_suspend(); @@ -1093,15 +1093,14 @@ static void stop_task(void *unused) blkdev_resume(); - /* Bring up all Ethernet interfaces. */ + rtnl_lock(); for ( i = 0; i < 10; i++ ) { sprintf(name, "eth%d", i); - if ( (dev = dev_get_by_name(name)) == NULL ) - continue; - dev_open(dev); - dev_put(dev); + if ( (dev = __dev_get_by_name(name)) != NULL ) + dev_open(dev); } + rtnl_unlock(); } static struct tq_struct stop_tq; -- 2.30.2